import { defHttp } from '@/utils/http/axios';

enum Api {
  paymentList = '/agent/finance/paymentList',
  bankList = '/agent/finance/bankList',
  bindPayment = '/agent/finance/bindPayment',
  editPayment = '/agent/finance/paymentEdit',
  withdrawalList = '/agent/withdrawal/index',
  withdrawalApp = '/agent/withdrawal/withdrawalApp',
  withdrawalCancel = '/agent/withdrawal/cancel',
  rechargeRecord = '/agent/rechargeRecords/index',
  transfer = '/agent/transfer/index',
}

export function GetPaymentListApi(params: any) {
  return defHttp.post<any>({
    url: Api.paymentList + `?page=${params.page}&limit=${params.pageSize}`,
    params,
  });
}

export function GetBankListApi() {
  return defHttp.post<any>({
    url: Api.bankList,
  });
}

export function BindPaymentApi(params: any) {
  return defHttp.post<any>({
    url: Api.bindPayment,
    params,
  });
}

export function GetWithdrawalListApi(params: any) {
  return defHttp.post<any>({
    url: Api.withdrawalList + `?page=${params.page}&limit=${params.pageSize}`,
    params,
  });
}

export function GetRechargeRecordListApi(params: any) {
  return defHttp.post<any>({
    url: Api.rechargeRecord + `?page=${params.page}&limit=${params.pageSize}`,
    params,
  });
}
export function GetTransferListApi(params: any) {
  return defHttp.post<any>({
    url: Api.transfer + `?page=${params.page}&limit=${params.pageSize}`,
    params,
  });
}

export function EditPaymentApi(params: any) {
  return defHttp.post<any>({
    url: Api.editPayment,
    params,
  });
}

export function WithdrawalAppApi(params: any) {
  return defHttp.post<any>({
    url: Api.withdrawalApp,
    params,
  });
}

export function WithdrawalCancelApi(id: number) {
  return defHttp.post<any>({
    url: Api.withdrawalCancel,
    params: { id },
  });
}
